Economic Status in PA
#palette defined
pal <- colorNumeric(
palette = "Blues",
domain = pacnty$Median_Income)
#leaflet plot with PA median income colored
leaflet(data = pacnty) %>%
addProviderTiles("Esri.WorldTopoMap", options = providerTileOptions(noWrap = TRUE)) %>%
addPolygons(color = ~pal(`Median_Income`), popup = ~paste0("<b>", NAME, ":</b> $", format(Median_Income, big.mark = ","))) %>%
addLegend(position = "topright", pal = pal, values = pacnty$Median_Income, title = "Median Income by County (dollars)")
Rail Lines in PA
#leaflet plot with Rail Lines
leaflet(data = rail) %>%
addProviderTiles("Stamen.Toner", options = providerTileOptions(noWrap = TRUE)) %>%
addPolylines(color = "#a8ddb5")
Schools in PA
#leaflet plot with clustered school locations
leaflet(data = school) %>%
addProviderTiles("Stamen.Terrain") %>%
addCircleMarkers(lng = ~Longitude, lat = ~Latitude, radius = 1.5, clusterOptions = markerClusterOptions())